package com.situ.day2;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

import org.junit.Test;

public class Dome1 {
	@Test
	public void test1() {
		Connection connection  = null;
		Statement statement = null;
		
		try {
			connection = JDBCUtilEnd.getConnection();
			connection.setAutoCommit(false);//手动提交
			statement = connection.createStatement();
			for (int i = 1; i < 200000; i++) {
				statement.addBatch ("INSERT INTO USER (NAME,PASSWORD) VALUES  ('玛丽亚"+i+"',6666);") ;
			}
			statement.executeBatch();
			connection.commit();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally {
			JDBCUtilEnd.close(connection, statement, null);
			
		}
		
	}

}
